package com.cpsdna.bean.document;

import com.cpsdna.bean.firm.Firm;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

import java.util.Date;

/**
 *
 * 文档表
 * Created by Jianghao on 2017/3/15.
 *
 * @author Howe(howechiang@gmail.com)
 */
@Table("document")
public class Document {

    /**
     * 文档Id
     */
    @Id
    @Column("document_id")
    private Integer documentId;

    public Integer getDocumentId() {
        return documentId;
    }

    public void setDocumentId(Integer documentId) {
        this.documentId = documentId;
    }

    /**
     * 文档名称
     */
    @Column("document_name")
    private String documentName;

    public String getDocumentName() {
        return documentName;
    }

    public void setDocumentName(String documentName) {
        this.documentName = documentName;
    }

    /**
     * 文件类型
     */
    @Column("file_type")
    private String fileType;

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    /**
     * 文件HASH值
     */
    @Column("file_hash")
    private String fileHash;

    public String getFileHash() {
        return fileHash;
    }

    public void setFileHash(String fileHash) {
        this.fileHash = fileHash;
    }

    /**
     * 文件上传时间
     */
    @Column("file_upload_time")
    private Date fileUploadTime;

    public Date getFileUploadTime() {
        return fileUploadTime;
    }

    public void setFileUploadTime(Date fileUploadTime) {
        this.fileUploadTime = fileUploadTime;
    }

    /**
     * 文件下载地址
     */
    @Column("file_download_url")
    private String fileDownloadUrl;

    public String getFileDownloadUrl() {
        return fileDownloadUrl;
    }

    public void setFileDownloadUrl(String fileDownloadUrl) {
        this.fileDownloadUrl = fileDownloadUrl;
    }

    /**
     * 文件大小
     */
    @Column("file_size")
    private Long fileSize;

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    /**
     * 文件归属公司ID
     */
    @Column("firm_id")
    private Integer firmId;

    public Integer getFirmId() {
        return firmId;
    }

    public void setFirmId(Integer firmId) {
        this.firmId = firmId;
    }

    /**
     * 公司表
     */
    @One(target = Firm.class, field = "firmId")
    private Firm firm;

    public Firm getFirm() {
        return firm;
    }

    public void setFirm(Firm firm) {
        this.firm = firm;
    }

    public Document(Integer documentId, String documentName, String fileType, String fileHash, Date fileUploadTime,
                    String fileDownloadUrl, Integer firmId, Long fileSize) {
        this.documentId = documentId;
        this.documentName = documentName;
        this.fileType = fileType;
        this.fileHash = fileHash;
        this.fileUploadTime = fileUploadTime;
        this.fileDownloadUrl = fileDownloadUrl;
        this.firmId = firmId;
        this.fileSize = fileSize;
    }

    public Document() {
    }

    @Override
    public String toString() {
        return "Document{" +
                "documentId=" + documentId +
                ", documentName='" + documentName + '\'' +
                ", fileType='" + fileType + '\'' +
                ", fileHash='" + fileHash + '\'' +
                ", fileUploadTime=" + fileUploadTime +
                ", fileDownloadUrl='" + fileDownloadUrl + '\'' +
                ", firmId='" + firmId + '\'' +
                ", fileSize='" + fileSize + '\'' +
                '}';
    }
}
